<?php /* Smarty version 2.6.26, created on 2012-05-12 14:28:12
         compiled from controllers%5Chome.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'rlHook', 'controllers\\home.tpl', 3, false),array('modifier', 'cat', 'controllers\\home.tpl', 10, false),)), $this); ?>
<!-- home tpl -->

<?php echo rlHook::load(array('name' => 'apTplHomeBeforeBlocks'), $this);?>


<table class="home_grag_drop" cellpadding="0" cellspacing="0">
<tr>
	<td valign="top" class="column1">
		<div class="sortable">
			<?php $_from = $this->_tpl_vars['ap_blocks']['column1']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['block']):
?>
				<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'homeDragDrop_block.tpl') : smarty_modifier_cat($_tmp, 'homeDragDrop_block.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?php endforeach; endif; unset($_from); ?>
		</div>
	</td>
	<td class="vspace"></td>
	<td valign="top" class="column2">
		<div class="sortable">
			<?php $_from = $this->_tpl_vars['ap_blocks']['column2']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['block']):
?>
				<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'homeDragDrop_block.tpl') : smarty_modifier_cat($_tmp, 'homeDragDrop_block.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?php endforeach; endif; unset($_from); ?>
		</div>
	</td>
</tr>

<tr>
	<td colspan="3" valign="top" class="column3">
		<div class="sortable">
			<?php $_from = $this->_tpl_vars['ap_blocks']['column3']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['block']):
?>
				<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'homeDragDrop_block.tpl') : smarty_modifier_cat($_tmp, 'homeDragDrop_block.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?php endforeach; endif; unset($_from); ?>
		</div>
	</td>
</tr>

<tr>
	<td valign="top" class="column4">
		<div class="sortable">
			<?php $_from = $this->_tpl_vars['ap_blocks']['column4']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['block']):
?>
				<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'homeDragDrop_block.tpl') : smarty_modifier_cat($_tmp, 'homeDragDrop_block.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?php endforeach; endif; unset($_from); ?>
		</div>
	</td>
	<td class="vspace"></td>
	<td valign="top" class="column5">
		<div class="sortable">
			<?php $_from = $this->_tpl_vars['ap_blocks']['column5']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['block']):
?>
				<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => ((is_array($_tmp=((is_array($_tmp='blocks')) ? $this->_run_mod_handler('cat', true, $_tmp, @RL_DS) : smarty_modifier_cat($_tmp, @RL_DS)))) ? $this->_run_mod_handler('cat', true, $_tmp, 'homeDragDrop_block.tpl') : smarty_modifier_cat($_tmp, 'homeDragDrop_block.tpl')), 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			<?php endforeach; endif; unset($_from); ?>
		</div>
	</td>
</tr>
</table>

<?php echo rlHook::load(array('name' => 'apTplHomeAfterBlocks'), $this);?>


<div class="hide" id="tmp_dom_blocks_store"></div>

<script type="text/javascript">
//<![CDATA[
<?php echo '

$(document).ready(function(){
	$(\'.home_grag_drop div.sortable\').sortable({
		placeholder: \'ui-state-highlight\',
		connectWith: \'.sortable\',
		handle: \'.move\',
		cursor: \'move\',
		forcePlaceholderSize: true,
		helper: \'clone\',
		opacity: 0.4,
		stop: function(event, ui){
			var column = $(ui.item).parent().parent().attr(\'class\');
			var items = \'\';
			var key = $(ui.item).attr(\'id\').split(\':\')[1];
			
			$(ui.item).parent().find(\'div.block\').each(function(){
				items += $(this).attr(\'id\').split(\':\')[1] +\'|\'+ $(this).index() +\',\';
			});
			
			items = items != \'\' ? rtrim(items, \',\') : items;
			
			/* save new arrangement */
			createCookie(\'ap_arrangement_\'+column, items, 365);

			/* fix all other entries */
			for ( var i=1; i<=5; i++ )
			{
				if ( column != \'column\'+i )
				{
					var cookie_line = readCookie(\'ap_arrangement_column\'+i);
					if ( cookie_line && cookie_line.indexOf(key) >= 0 )
					{
						var exp_line = cookie_line.split(\',\');
						
						for ( var j=0; j<exp_line.length; j++ )
						{
							var found_index = exp_line[j].indexOf(key);
							if ( found_index >= 0 )
							{
								exp_line.splice(j, 1);
							}
						}
						
						eraseCookie(\'ap_arrangement_column\'+i);
						if ( exp_line.length > 0 )
						{
							createCookie(\'ap_arrangement_column\'+i, exp_line.join(\',\'), 365);
						}
					}
				}
			}
		}
	}).disableSelection();
});

'; ?>

//]]>
</script>

<?php echo rlHook::load(array('name' => 'apTplHomeBottom'), $this);?>


<!-- home tpl end -->